﻿using System;
using H2.NET.Web.Workflow.DwzCode;

namespace H2.NET.Web.Pages.SMD
{
    public partial class MasterDataChange : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            var action = ((object[])TaskAPI["Actions"])[0].ToString();

            var parameters = string.Empty;

            // 判断打开的方式
            var taskid = Request.QueryString["taskid"];
            var p = Request.QueryString["p"];
            var i = Request.QueryString["i"];
            var s = Request.QueryString["s"];
            if (string.IsNullOrEmpty(taskid))
            {
                parameters = string.Format("p={0}&i={1}&s={2}", p, i, s);
            }
            else
            {
                parameters = "taskid=" + taskid;
            }

            // 重定向
            if (string.IsNullOrEmpty(action))
            {
                Response.Redirect("ChangeStore.aspx?" + parameters);
            }
            else
            {
                Response.Redirect(action + ".aspx?" + parameters);
            }
        }
    }
}
